<template>
	<view>
		<view style="position: fixed;height: 115rpx;width: 750rpx;display: flex;align-items: center;padding-top:60rpx ;background: #FFFFFF;top: 0;">
			<view style="margin-left: 314rpx;font-size: 33.83rpx;color: #3C3C3C;letter-spacing: 2rpx;">我的收益</view>
		</view>
		<view style="margin-top: 210.4rpx;">
			<view class="beijing">
				<view style="display: flex;">
					<view style="min-width: 230rpx;">
						<view class="xiamian">总收益</view>
						<view>
							<text class="qianshu">{{earnTotal}}</text>
							<text class="yuan">元</text>
						</view>
					</view>
					<view style="margin-left: 94.8rpx;">
						<view class="xiamian">今日收益</view>
						<view>
							<text class="qianshu">{{earnDay}}</text>
							<text class="yuan">元</text>
						</view>
					</view>
				</view>
				<view style="width: 617rpx;height: 1rpx;background: #FFFFFF;margin: 29rpx 0;"></view>
				<view style="display: flex;">
					<view>
						<view class="zai_xia">已结算</view>
						<view>{{settled}}</view>
					</view>
					<view style="margin-left: 149rpx;">
						<view class="zai_xia">待结算</view>
						<view>{{noSettlement}}</view>
					</view>
				</view>
				<view style="width: 40rpx;height: 40rpx;position: absolute;top: 30rpx;left: 630rpx;">
					<image :src="wenhao" style="width: 40rpx;height: 40rpx;"></image>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data(){
			return {
				mechanism_id: "",
				earnDay: 0,
				earnTotal: 0,
				settled: 0,
				noSettlement: 0,
				wenhao: "http://img.curiousmore.com/212692"
			}
		},
		methods:{
			
		async	shouyi_tou(){
				const res = await this.$myRequest({
					url:"/rechargerecord/queryMechanismOfflineDetailsCount",
					
					data:{
						mechanism_id: this.mechanism_id
					}
				})
				this.earnDay = res.data.earnDay
				this.earnTotal = res.data.earnTotal
				this.settled = res.data.settled
				this.noSettlement = res.data.noSettlement
			},
			
		async	collect() {
				const res = await this.$myRequest({
					url: "/rechargerecord/queryMechanismOfflineDetails",
					data: {
						id: this.mechanism_id,
						finished: true,
						study_type: "mechanism_offline"
					}
				})
			}
			
		},
		onLoad() {
			try{
				this.mechanism_id = uni.getStorageSync('userif_list').mechanism_id
				this.shouyi_tou()
				this.collect()
			}catch(e){}
		},
		onShow() {
			
		}
	}
</script>

<style lang="scss" scoped>
	.beijing{
		background-image:url(http://img.curiousmore.com/636344);
		background-size:694rpx 325rpx;
		height: 325rpx;
		width:694rpx ;
		margin-left: 27.77rpx;
		box-sizing: border-box;
		padding: 28rpx 35rpx  32rpx 42rpx;
		color: #FFFFFF;
		font-size: 30rpx;
		position: relative;
		.xiamian{
			margin-bottom: 22rpx;
		}
		.qianshu{
			font-size: 40rpx;
			font-weight: bold;
		}
		.yuan{
			margin-left: 26rpx;
		}
		.zai_xia{
			margin-bottom: 18rpx;
		}
	}
</style>

